<%@ page contentType="text/html;charset=UTF-8" %>

<html>
<head>
	<title>信息分类管理</title>
	 <%@ include file="/common/meta.jsp" %>
	<%@ include file="/common/import.jsp" %>
	<!--<link rel="stylesheet" type="text/css" href="${ctx}/js/easyui/themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="${ctx}/js/easyui/themes/demo.css">
	--><script type="text/javascript">
		$(function(){
			$('#sortList').datagrid({
				title:'信息分类列表',
				iconCls:'icon-ok',
				url:'${ctx}/info/core/info!data.action?sortDisable=1',
				striped: true,
				collapsible:false,				
				fitColumns: true,
				pagination:true,
				singleSelect:true,
				rownumbers:true,
				remoteSort: false,
				pageList:[10,15,20,30],
				idField:'sortId',
				columns:[[
					{field:'sortCode',title:'分类编号',width:100},
					{field:'sortName',title:'分类名称',width:100},
					{field:'infoTableName',title:'表名称',width:100},
					{field:'sortStatus',title:'状态',width:100,
						formatter:function(value){
							if(value=="0"){
							    return "未启用";
							}else{
							    return "已启用";
							}
						}
					},
					{field:'sortId',title:'操作',width:100,
						formatter:function(value,rowData){
						    var str ="";
							if(rowData.sortStatus=="1"){
								if(rowData.sortDisable=="1"){
								    str += "<a href='javascript:void(0);' onclick=\"checkInfoList('"+rowData.sortId+"','"+rowData.sortName+"')\">信息审核</a>";
								}
							} 
							return str;
						}
					}
				]]
			});
		});
			
		// 刷新列表
		function reload(){
			$('#sortList').datagrid('reload');
		}
	
		// 判断是否选中了需要操作的数据[修改、删除]
		function getSelected(){
			var selected = $('#sortList').datagrid('getSelected');
			if (selected){
				return selected;
			}else{
				$.messager.alert('提示', '请选择要操作的数据', 'info');
			}
		}

		var widthcount = $(document.body).width()-20; 
		var leftcount = document.documentElement.scrollLeft;
		function checkInfoList(sortId,sortName){
			if(sortId){
				var deptListUrl = '${ctx}/info/operate/operate.action?sortId='+sortId;
				if ($.isFunction(window.parent.addTab)){
				    window.parent.addTab('信息审核['+sortName+']',deptListUrl,'icon-dept');
				}else{
					$('#orgDeptWin').css({"width":widthcount,"height":"450px","left":leftcount});
					$('#orgDeptFrame').attr("src",deptListUrl);
					$('#orgDeptWin').panel('setTitle',"信息审核["+sortName+"]");
					$('#orgDeptWin').window('open');
				}
			}
		}
	</script>
</head>
<body>
	<!-- 应用列表 -->
	<table id="sortList"></table>
	
	<div id="orgDeptWin" class="easyui-window" title="信息审核" style="padding:5px;float:left;top:10px;" iconCls="icon-search" closed="true" minimizable="false" maximizable="false" maximized="true" collapsible="false">
   	 <iframe frameborder="0" id="orgDeptFrame" height="100%" width="100%" scrolling="No" frameborder="0" ></iframe>
    </div>
</body>
</html>